﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MetaProperties.Collections
{
    using System.Collections;
    using System.Collections.ObjectModel;
    using System.Collections.Specialized;

    public partial class ObservableList<ItemT>
    {
        /// <summary>
        /// Clears this instance.
        /// </summary>
        public void Clear()
        {
            this.items.Clear();

            ////// NB: The items.Clear() method raises a Reset event for clear, which isn't
            ////// very helpful if we need to tidy up.  We'll raise a Remove event instead.
            ////if (this.items.Count != 0)
            ////{
            ////    NotifyCollectionChangedEventArgs args = null;
            ////    this.SurpressChangedEvents = true;
            ////    try
            ////    {
            ////        IList oldItems = new ArrayList(this.items);

            ////        this.items.Clear();

            ////        args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, oldItems, 0);
            ////    }
            ////    finally
            ////    {
            ////        this.SurpressChangedEvents = false;
            ////    }

            ////    this.Items_CollectionChanged(this, args);
            ////}
        }
    }
}
